package com.example.mxs.service;

import com.example.mxs.dao.MenuRepository;
import com.example.mxs.dao.UserRepository;
import com.example.mxs.domain.Menu;
import com.example.mxs.domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.*;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Optional;

@Service
public class MenuServiceImpl implements MenuService {

    @Autowired
    MenuRepository menuRepository;


    @Override
    public List<Menu> getMenus() {

        return menuRepository.findAllByLevel(0);
    }
}
